namespace LogFileSystem
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var builder = WebApplication.CreateBuilder(args);

            // Add services to the container.
            builder.Services.AddCors(options => {
                options.AddPolicy("DevCors", builder =>
                    builder.AllowAnyOrigin()       // 开发环境临时使用（生产环境禁用！）
                           .AllowAnyMethod()
                           .AllowAnyHeader()
                );
            });
            builder.Services.AddControllers();

            var app = builder.Build();
         

            // Configure the HTTP request pipeline.
            app.UseStaticFiles();
           // app.UseHttpsRedirection();

            app.UseAuthorization();
            app.UseCors("DevCors");

            app.MapControllers();

            app.Run();
        }
    }
}
